<!--
  
   OrbitalEditor.xaml
  
   Copyright (c) 2007 Mike Strobel
  
   This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
   For details, see <http://www.opensource.org/licenses/ms-rl.html>.
  
   All other rights reserved.
  
  -->
<local:EditorBase x:Class="Supremacy.Editor.OrbitalEditor"
                  xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
                  xmlns:s="clr-namespace:Supremacy.Client;assembly=SupremacyWPF"
                  xmlns:local="clr-namespace:Supremacy.Editor"
                  xmlns:tech="clr-namespace:Supremacy.Tech;assembly=SupremacyCore"
                  xmlns:econ="clr-namespace:Supremacy.Economy;assembly=SupremacyCore"
                  xmlns:orbitals="clr-namespace:Supremacy.Orbitals;assembly=SupremacyCore"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:Controls="clr-namespace:Avalon.Windows.Controls;assembly=AvalonLibrary">
  <local:EditorBase.Resources>
    <DataTemplate x:Key="GroupBoxHeaderTemplate">
      <TextBlock FontWeight="Bold"
                 Text="{Binding}" />
    </DataTemplate>
    <!--<Style TargetType="{x:Type Label}">
      <Setter Property="FontWeight"
              Value="Bold" />
    </Style>-->
  </local:EditorBase.Resources>
  <DockPanel LastChildFill="True"
             Margin="9,12,0,12">
    <Controls:AutoGrid DockPanel.Dock="Left"
                       ChildMargin="3"
                       Margin="0,6,0,0"
                       ChildHorizontalAlignment="Stretch"
                       ChildVerticalAlignment="Stretch"
                       VerticalAlignment="Top">
      <Controls:AutoGrid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"
                          SharedSizeGroup="EditorLeftColumnGroup" />
        <ColumnDefinition Width="Auto" />
      </Controls:AutoGrid.ColumnDefinitions>
      <Label Target="{Binding ElementName=CrewSizeText}"
             Content="Crew Size:"
             FontWeight="Bold" />
      <TextBox x:Name="CrewSizeText"
               Width="64"
               HorizontalAlignment="Left"
               Text="{Binding Path=CrewSize}" />
      <Label Target="{Binding ElementName=HullStrengthText}"
             Content="Hull Strength:"
             FontWeight="Bold" />
      <TextBox x:Name="HullStrengthText"
               Width="64"
               HorizontalAlignment="Left"
               Text="{Binding Path=HullStrength}" />
      <Label Target="{Binding ElementName=ShieldStrengthText}"
             Content="Shield Strength:"
             FontWeight="Bold" />
      <TextBox x:Name="ShieldStrengthText"
               Width="64"
               HorizontalAlignment="Left"
               Text="{Binding Path=ShieldStrength}" />
      <Label Target="{Binding ElementName=ShieldRechargeRateText}"
             Content="Shield Recharge:"
             FontWeight="Bold" />
      <TextBox x:Name="ShieldRechargeRateText"
               Width="64"
               HorizontalAlignment="Left"
               Text="{Binding Path=ShieldRechargeRate, Mode=TwoWay}" />
      <Label Target="{Binding ElementName=ScienceAbilityText}"
             Content="Science Ability:"
             FontWeight="Bold" />
      <TextBox x:Name="ScienceAbilityText"
               Width="64"
               HorizontalAlignment="Left"
               Text="{Binding Path=ScienceAbility}" />
      <Label Target="{Binding ElementName=ScanStrengthText}"
             Content="Scan Strength:"
             FontWeight="Bold" />
      <TextBox x:Name="ScanStrengthText"
               Width="64"
               HorizontalAlignment="Left"
               Text="{Binding Path=ScanStrength}" />
      <Label Target="{Binding ElementName=SensorRangeText}"
             Content="Sensor Range:"
             FontWeight="Bold" />
      <TextBox x:Name="SensorRangeText"
               Width="64"
               HorizontalAlignment="Left"
               Text="{Binding Path=SensorRange}" />
      <Label Target="{Binding ElementName=RawMaterialsText}"
             Content="Raw Materials:"
             FontWeight="Bold" />
      <TextBox x:Name="RawMaterialsText"
               Width="64"
               HorizontalAlignment="Left"
               Text="{Binding Path=RawMaterials, Mode=TwoWay}" />
    </Controls:AutoGrid>
    <WrapPanel Orientation="Horizontal">
      <GroupBox Header="Energy Weapons"
                Margin="12,0,0,6"
                HeaderTemplate="{StaticResource GroupBoxHeaderTemplate}"
                VerticalAlignment="Top">
        <Controls:AutoGrid ChildMargin="3"
                           ChildHorizontalAlignment="Stretch"
                           ChildVerticalAlignment="Stretch"
                           VerticalAlignment="Top">
          <Controls:AutoGrid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
          </Controls:AutoGrid.ColumnDefinitions>
          <Label   Content="Name:" />
          <TextBox Width="96"
                   HorizontalAlignment="Left"
                   Text="{Binding Path=PrimaryWeaponName, Mode=TwoWay}" />
          <Label Content="Count:" />
          <TextBox Width="96"
                   HorizontalAlignment="Left"
                   Text="{Binding Path=PrimaryWeapon.Count, Mode=TwoWay}" />
          <Label Content="Damage:" />
          <TextBox Width="64"
                   HorizontalAlignment="Left"
                   Text="{Binding Path=PrimaryWeapon.Damage, Mode=TwoWay}" />
          <Label Content="Refire:" />
          <TextBox Margin="2,3,2,3"
                   Width="64"
                   HorizontalAlignment="Left"
                   Text="{Binding Path=PrimaryWeapon.Refire, Mode=TwoWay}" />
          <Label Content="Delivery:" />
          <ComboBox SelectedItem="{Binding Path=PrimaryWeapon.DeliveryType, Mode=TwoWay}">
            <orbitals:WeaponDeliveryType>Beam</orbitals:WeaponDeliveryType>
            <orbitals:WeaponDeliveryType>Pulse</orbitals:WeaponDeliveryType>
          </ComboBox>
        </Controls:AutoGrid>
      </GroupBox>
      <GroupBox Header="Projectile Weapons"
                Margin="12,0,0,6"
                HeaderTemplate="{StaticResource GroupBoxHeaderTemplate}"
                VerticalAlignment="Top">
        <Controls:AutoGrid ChildMargin="3"
                           ChildHorizontalAlignment="Stretch"
                           ChildVerticalAlignment="Stretch"
                           VerticalAlignment="Top">
          <Controls:AutoGrid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
          </Controls:AutoGrid.ColumnDefinitions>
          <Label   Content="Name:" />
          <TextBox Width="84"
                   HorizontalAlignment="Left"
                   Text="{Binding Path=SecondaryWeaponName, Mode=TwoWay}" />
          <Label Content="Count:" />
          <TextBox Width="64"
                   HorizontalAlignment="Left"
                   Text="{Binding Path=SecondaryWeapon.Count, Mode=TwoWay}" />
          <Label Content="Damage:" />
          <TextBox Width="64"
                   HorizontalAlignment="Left"
                   Text="{Binding Path=SecondaryWeapon.Damage, Mode=TwoWay}" />
          <Label Content="Delivery:" />
          <ComboBox SelectedItem="{Binding Path=SecondaryWeapon.DeliveryType, Mode=TwoWay}">
            <orbitals:WeaponDeliveryType>Torpedo</orbitals:WeaponDeliveryType>
            <orbitals:WeaponDeliveryType>Missile</orbitals:WeaponDeliveryType>
          </ComboBox>
        </Controls:AutoGrid>
      </GroupBox>
    </WrapPanel>
  </DockPanel>
</local:EditorBase>